package com.swt.gap.dao;

import com.github.pagehelper.Page;
import com.swt.gap.model.entity.TaskResultWithBLOBs;
import com.swt.gap.model.vo.taskresult.AnalysisResultVO;
import com.swt.gap.model.vo.taskresult.TaskAndResult;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TaskResultMapper {
    int deleteByPrimaryKey(Integer resultId);

    int insertSelective(TaskResultWithBLOBs record);

    TaskResultWithBLOBs selectByPrimaryKey(Integer resultId);

    int updateByPrimaryKeySelective(TaskResultWithBLOBs record);

    int deleteTaskResult(Integer resultId);

    int deleteByTaskId(Integer taskId);

    TaskResultWithBLOBs selectByResultName(String resultName, Integer createdBy, Integer taskId);

    List<TaskResultWithBLOBs> getResults(Integer taskId);

    //分析结果名称模糊查询
    Page<TaskAndResult> getTaskResultInfoByKeyword(@Param("taskId") Integer taskId, @Param("keyword")String keyword);

    List<TaskResultWithBLOBs> selectResultByTaskAndName(@Param("taskId") Integer taskId, @Param("keyword")String keyword);

    Integer LastSameNameIndex(@Param("taskId") int taskId,@Param("resultName") String resultName);

    Page<AnalysisResultVO> selectByUserIdAndKeyword(@Param("userIds") List<Integer> userIds, @Param("keyword")String keyword);
}